package org.jeecg.modules.util.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.jeecg.modules.util.entity.TigerDataBackup;
import org.jeecg.modules.util.entity.TigerDataBackupTables;
import org.jeecg.modules.util.mapper.TigerDataBackupMapper;
import org.jeecg.modules.util.service.ITigerDataBackupService;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;

/**
 * @Description: 数据库备份
 * @Author: jeecg-boot
 * @Date:   2022-07-22
 * @Version: V1.0
 */
@Service
public class TigerDataBackupServiceImpl extends ServiceImpl<TigerDataBackupMapper, TigerDataBackup> implements ITigerDataBackupService {

    @Override
    public boolean getReady() {
        QueryWrapper<TigerDataBackup> qw = new QueryWrapper<>();
        qw.ne("run_status","0");
        List<TigerDataBackup> data = this.getBaseMapper().selectList(qw);
        if(data == null || data.size() == 0)
            return true;
        return false;
    }

}
